<template>
  <a href="javascript:;" v-if="!isLogin" @click.stop="toLogin" class="color-1 login-show" >
    <strong class="login-show">登录可见</strong></a>
  <a href="javascript:;" v-else-if="auditStatus==1" @click.stop="toComplete" class="color-1 login-show" >
    <strong class="login-show">待完善资料</strong></a>
  <span v-else-if="auditStatus==2">审核中</span>
  <a href="javascript:;" v-else-if="auditStatus==4" @click.stop="toComplete" class="color-1 login-show" >
    <strong class="login-show">审核未通过</strong></a>
  <span v-else-if="isLogin && !showPrice">无权查看</span>
  <span class="color-1" v-else-if="isLogin && showPrice" >￥<strong>{{priceUnit | money}}</strong>{{unitName | filterUnitName}}</span>
</template>
<script>
    export default {
        props: {
            priceUnit: {
              default: '0'
            },
            unitName: {
              default: '件'
            }
        },
        data() {
            return {
              isLogin: !!Cookie.get('name'),
              showPrice: Cookie.get('showPrice')!=0,
              auditStatus: Cookie.get('auditStatus')
            };
        },
        methods: {
          /**
           * 跳转登录页面
           * */
          toLogin(){
            this.$router.push({name: 'login'});
          },
          toComplete: function () {
            this.$router.push({name: 'complete'});
          }
        },
        filters: {
          filterUnitName(unitName){
              if(unitName!=''){
                  return '/' + unitName;
              }
              return ''
          }
        },
        created() {

        },
        mounted(){

        },
        components: {}
    };
</script>
<style lang="less">
</style>
